package com.CGFrame.gantt;

import java.util.Iterator;

import org.jfree.chart.labels.CategoryToolTipGenerator;
import org.jfree.data.category.CategoryDataset;

import com.CGFrame.struts.POJOs.Make;
import com.CGFrame.struts.POJOs.Task;
import com.CGFrame.struts.bean.ProjectOperate;

public class CustomGanttToolTips implements CategoryToolTipGenerator {
	
	String []str_Ids ;
	public CustomGanttToolTips(StringBuffer ids)
	{
		this.str_Ids = ids.toString().split(";");
	}
	public String generateToolTip(CategoryDataset dataSet, int series, int category) {
		// TODO Auto-generated method stub
//		System.out.println(category);
		
/*		
		String description = com.toString();
		String []names = description.split(":");
		StringBuffer tip = new StringBuffer("");
		if ( names[0].equals("����") )			
		{
			ProjectOperate pop = ProjectOperateFactory.getprojectOperate();
			Make make = (Make)pop.UniqueQuery("Make", "makeName,"+names[1]);
			Iterator ite_Tasks = make.getTasks().iterator();
			while ( ite_Tasks.hasNext())
			{
				Task task = (Task)ite_Tasks.next();
				tip.append(task.getTaskName());
			}
		}
		return tip.toString();
		*/
		return str_Ids[category].split(",")[2];//  str_Ids[category] ��ʽ�磺type,id,tips
	}

}
